package com.jiangxjsy.core.common;

import com.jiangxjsy.core.constant.AdminModuleConstant;
import lombok.Getter;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/8 15:25
 */

@Getter
public enum AdminModule {
    TASK_EXAMINE(AdminModuleConstant.TASK_EXAMINE),
    CRM(AdminModuleConstant.CRM),
    PROJECT(AdminModuleConstant.PROJECT),
    LOG(AdminModuleConstant.LOG),
    BOOK(AdminModuleConstant.BOOK),
    OA(AdminModuleConstant.OA),
    BI(AdminModuleConstant.BI),
    EMAIL(AdminModuleConstant.EMAIL),
    CALENDAR(AdminModuleConstant.CALENDAR),
    KNOWLEDGE(AdminModuleConstant.KNOWLEDGE),
    CALL(AdminModuleConstant.CALL),
    HRM(AdminModuleConstant.HRM),
    JXC(AdminModuleConstant.JXC);

    private final String module;

    AdminModule(String module) {
        this.module = module;
    }

    // parse <==> valueOf
    public static AdminModule parse(String module) {
        for (AdminModule value : values()) {
            if (value.module.equals(module)) {
                return value;
            }
        }
        return null;
    }

    public static String[] getValues() {
        String[] values = new String[values().length];
        for (int i = 0; i < values().length; i++) {
            values[i] = values()[i].getModule();
        }
        return values;
    }
}
